home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / lvswin.zip / WINOBJ.DOC < prev    next >
Text File  |  1991-10-28  |  89KB  |  2,312 lines

  1.                                LVS Windows (tm)
  2.                                      v2.31
  3.  
  4.                           The C++ Window Class System
  5.                                       by
  6.                               Lake View Software
  7.  
  8.  
  9.                     Copyright (c) 1991, Lake View Software
  10.                               All Rights Reserved
  11.  
  12.  
  13.                             Features of LVS Windows
  14.  
  15.  
  16.             - Powerful windowing system.  Allows as many window objects as
  17.             memory permits.  Windows objects can be stacked, tiled, moved,
  18.             resized, and changed in many other ways.  There is a whole
  19.             assortment of various input and output messages to interact with
  20.             windows.  All windows are active and can be written to at any time.
  21.  
  22.             - All windows can be virtual.  This allows you to create windows
  23.             larger than the screen.  Data entry screens automatically pan around
  24.             the virtual window as the user moves the cursor.  The user can also
  25.             use the mouse to pan a window.
  26.  
  27.             - Multi-field formatted data entry.  You can create data entry forms
  28.             that consist of one or more input fields.  You have full control
  29.             over user input and can tie validation functions into each input
  30.             field.
  31.  
  32.             - As of version 1.6, there are functions specific designed to
  33.             support the Paradox Engine.  Paradox Engine is a trade mark of
  34.             Borland.  These functions allow you to read user input directly from
  35.             a Paradox Record Buffer.  Large model only.
  36.  
  37.             - An all new Printer class system with version 1.5.  This has the
  38.             same powerful formatting features of the windowing system, because
  39.             its a child class of WinObj.
  40.  
  41.             - Moving bar menus.  You can easily create pop-up, pull-down, and
  42.             Lotus-style menus, as well as any other custom menu that you can
  43.             define.  All with automatic mouse support.
  44.  
  45.             - Scrollable pick menus.  Allow you to pick one item from a list of
  46.             items.  Also with mouse support.
  47.  
  48.             - Several video output methods.  These include direct screen
  49.             writing, CGA snow reduction, and video BIOS writing.  28 and 50 line
  50.             modes available on color VGA screens.
  51.  
  52.             - Keyboard management routines.  Allows you to tie keystrokes to
  53.             functions, and specify a function to be called while waiting for a
  54.             keypress.
  55.  
  56.             - Full mouse support is available with all these routines.  One
  57.             function call and the mouse is enabled.  No other work necessary,
  58.             though you can manipulate mickey if you wish.
  59.  
  60.             - A interactive screen painter.  This will allow for simple creation
  61.             of windowed screen data entry.  See SCR.DOC
  62.  
  63.                           Registration Information
  64.  
  65.  
  66.  
  67.       LVS Windows is distributed as User-Supported software.  You are free to
  68.       copy and distribute this software freely*, however, if you find it of use
  69.       to you, you are encouraged to register your copy.  Registering your copy
  70.       of the software helps the author continue to provide professional quality
  71.       software at very reasonable prices.
  72.  
  73.       *** Only Small Memory Model Libraries may be distributed ***
  74.       *** with out written consent from Lake View Software *****
  75.  
  76.       The Full Registration is $50.00 and includes all memory models plus full
  77.       library source.  The library is completely written in C++ using Borland's
  78.       Turbo C++ v1.0.  All window classes use the same low-level C functions. 
  79.       This allows easy porting to other operating systems.  This will also
  80.       include source to the interactive screen painter.
  81.  
  82.       All materials are shipped on 5.25-inch or 3.5-inch floppy diskettes. 
  83.       Please specify when ordering.
  84.  
  85.       U.S. orders add $4.00 shipping & handling.
  86.  
  87.       Non-U.S. orders need to include $5.00 extra to cover additional shipping
  88.       and handling charges.  Checks and money orders must be drawn on a U.S.
  89.       bank.  Total of $59.00 US dollars
  90.       
  91.       To order direct from LVS, Please send all payments payable in U.S. 
  92.       Dollars to:
  93.  
  94.                       ╔════════════════════════════════╗
  95.                       ║       Lake View Software       ║
  96.                       ║       4321 Harborough Rd.      ║
  97.                       ║       Columbus, OH 43220       ║
  98.                       ╚════════════════════════════════╝
  99.  
  100.       All major upgrades will be available for only $15.00 + $4.00 s/h.
  101.       Registered users will be notified of all major upgrades.
  102.  
  103.       All non-major upgrades will be available for a $4.00 shipping fee.
  104.       All new releases will be posted on CompuServe in the BPROGB forum.
  105.  
  106.       Please report any errors (BUGS) or suggestions
  107.       to Lake View Software or:
  108.  
  109.                   CompuServe:  70004,524
  110.  
  111.  
  112.       You can order directly from Lake View Software with a check or money
  113.       order,  or from the Public (software) Library with your MC, Visa, AMX or
  114.       Discover    card by  calling 800-2424-PsL, P.O. Box 35705, Houston, Texas
  115.       77235-5705.  PsL is for ordering only.  For information about dealer
  116.       pricing, volume discounts, site licensing, shipping of product, returns,
  117.       latest version number or other technical information,  Send your request
  118.       to Lake View Software at the above address or send an Easy Plex on
  119.       CompuServe at [70004,524].
  120.  
  121.       When ordering from Public (software) Library refer to this product number: 
  122.       #10224.
  123.                                     Files
  124.  
  125.  
  126.       WINOBJ.WP         This file, in Word Perfect 5.1 format.
  127.       WINOBJ.DOC        This file in DOS text format.
  128.  
  129.       WINOBJ_S.LIB      WinObj library.  You must link to this file to use any
  130.                         of the windows object messages.  The demo is distributed
  131.                         with the Small model library only.
  132.  
  133.       WINOBJ.HPP        WinObj class definitions.  Must be #included in your
  134.                         program to link with winobj.lib.  This will also include
  135.                         win.h.  Always use the header files that come with the
  136.                         library, discard previous versions.
  137.  
  138.       WINMOUSE.HPP      WinMouse class definitions.  Generaly you will only use
  139.                         one routine from this header.  Win_mouse_mode ();
  140.  
  141.       WINMENU.HPP       WinMenu class definitions.  Must be #included in any
  142.                         program using the menuing system.  This header file will
  143.                         include winobj.hpp with it.
  144.  
  145.       WINPICK.HPP       WinPick class definitions.  Will include winobj.hpp with
  146.                         it.
  147.  
  148.       WIN.H             Defines low level .C functions used by WinObj.lib.  Also
  149.                         defines various window function options and key strokes. 
  150.                         This is automatically included with winobj.hpp or any
  151.                         other winobj class headers.
  152.  
  153.       DEMO.EXE          A demo program written using LVS Windows.  This demo
  154.                         uses many of the key features of LVS and makes a good
  155.                         working example.
  156.  
  157.       DEMO.CPP          Source code for the demo.
  158.  
  159.       SCR.EXE           An interactive screen painter.  This program can greatly
  160.                         aid in designing screens.  When finished you can produce
  161.                         the base source code for your applications. 
  162.  
  163.                         The screen painter was written using LVS Windows. 
  164.                         Registered users will receive complete C++ source to
  165.                         SCR.EXE.
  166.  
  167.       SCR.DOC           Interactive Screen Painter documentation.
  168.                           Declaring a Window Object
  169.  
  170.  
  171.  
  172. WinObj <Object> (int v_h=0,int v_w=0)
  173.  
  174.       v_h   Virtual height of the window.  Default is 0  If declared as the
  175.             default (0) then the virtual height will be set to the height of the
  176.             window when it is opened.
  177.  
  178.       v_w   Virtual width of the window.  Default is 0  If declared as the
  179.             default (0) then the virtual width will be set to the width of the
  180.             window when it is opened.
  181.  
  182.             The virtual height and width can be changed any time the window is
  183.             not opened, using the set_virtual message.
  184.  
  185.             EXAMPLE:
  186.                         WinObj window_a;
  187.                         main()
  188.                         {
  189.                               WinObj window_b ( 100, 100);
  190.                               ~ ~ ~ ~
  191.                               ~ ~ ~
  192.                               ~ ~ ~
  193.                         }
  194.                                WinObj Routines
  195.  
  196.  
  197.  
  198. box
  199.       Draw a box in the window.  The current window attribute will be used.  The
  200.       cursor position will be unchanged.
  201.  
  202.       USAGE:      void box (int sr, int sc, int er, int ec, int type =
  203.                   W_SINGLE);
  204.  
  205.             sr = start row.
  206.             sc = start column.
  207.             er = end row.
  208.             ec = end column.
  209.             type = Box style.  Can be any of the valid border styles.
  210.  
  211. ========================================
  212.  
  213. center
  214.       Centers a string in the virtual window, using the current attribute.
  215.  
  216.       USAGE:      int center (int y, char *str);
  217.  
  218.  
  219.       RETURNS:    W_OK, W_NOTOPEN
  220. ========================================
  221. change_border
  222.       Changes the border style for the window object.  Optionally changes the
  223.       border color.
  224.  
  225.       USAGE:      void change_border (int type, int color = -1);
  226.  
  227.       Required arguments.
  228.             type        new border type.  Use any of the types below.
  229.                         W_SPACES          W_SINDOU
  230.                         W_DOUBLE          W_SINGLE
  231.                         W_DOUSIN          W_SOLID
  232.  
  233.       Optional arguments.
  234.             color       new border attribute.  Default is -1 which will leave
  235.                         border color unchanged.
  236.  
  237.       EXAMPLE:
  238.             main()
  239.             {
  240.                   WinObj a;
  241.                   a.open (12,12,20,50);
  242.                   ~~~
  243.                   a.change_border ( W_DOUSIN, _BLUE|WHITE);
  244.                   ~~
  245.                   ~
  246.                   a.close();
  247.             }
  248. =======================================
  249. close
  250.       Close the window object.  A window object can be opened and closed as
  251.       often as you like through its life.  A window will automatically be closed
  252.       when it leaves the scope of your application.
  253.  
  254.       USAGE:      void close();
  255.  
  256.       EXAMPLE:
  257.             main()
  258.             {
  259.                   WinObj a;
  260.                   a.open (12,12,20,50);
  261.                   ~~~
  262.                   ~~
  263.                   ~
  264.                   a.close();
  265.                   a.open (10,10,15,35,W_SPACES,_BLUE|GREEN);
  266.                   a.close();
  267.             }
  268.  
  269. =======================================
  270. clr_eol
  271.       Clears the window to the end of the current line.  The cursor position is
  272.       not changed.
  273.  
  274.       USAGE:      void clr_eol ();
  275.  
  276. =======================================
  277. clr_win
  278.       Clears the window with the current attribute.
  279.  
  280.       USAGE:      void clr_win ();
  281.  
  282.       EXAMPLE:
  283.             main()
  284.             {
  285.                   WinObj a;
  286.                   a.open (1,1,12,40);
  287.                   a.printf ("This is a test string.");
  288.                   a.set_attr (_BLUE|WHITE);
  289.                   a.clr_win ();
  290.                   a.close ();
  291.             }
  292. =======================================
  293. del_line
  294.       Deletes a line in the window object.  All text below the line is pulled up
  295.       and a blank line is inserted at the end.  The cursor position will not be
  296.       changed.
  297.  
  298.       USAGE:      void del_line (int y);
  299.  
  300.             y     row to be deleted.
  301.  
  302. =======================================
  303. gotoxy
  304.       Move the cursor inside the window.
  305.  
  306.       USAGE:      void gotoxy (int y = 0, int x = 0);
  307.  
  308.       Optional arguments.
  309.             y     New y location.  default to origin.  If y is 1 greater than
  310.                   max_y the window will scroll up 1 line and a blank line will
  311.                   be inserted at the end.
  312.  
  313.             x     New x location.  default to origin.
  314.  
  315.       EXAMPLE:
  316.             main()
  317.             {
  318.                   WinObj a;
  319.                   a.open (12,12,20,50);
  320.                   ~~~
  321.                   a.gotoxy(5,5);
  322.                   ~
  323.                   a.close();
  324.             }
  325. =======================================
  326. hide
  327.       Hides the window object.  None of the window contents will be changed.
  328.  
  329.       USAGE:      void hide ();
  330.  
  331. =======================================
  332. ins_line
  333.       Insert a line in the window object.  All text from the line down is pushed
  334.       down. The last line will be pushed out of the window.  A blank line will
  335.       be inserted.  The cursor position will not change.
  336.  
  337.       USAGE:      void ins_line (int y);
  338.  
  339.             y     row number to be inserted.
  340.  
  341. =======================================
  342. move
  343.       Moves a window on the screen.  The window contents are left in tact.  The
  344.       window does not have to be active to move.  It will slide under other
  345.       windows if needed.
  346.  
  347.       USAGE:      int move (int start_y, int start_x);
  348.  
  349.             start y/x   new start coordinates for the upper left of the window
  350.                         object.
  351.  
  352.       RETURNS:    W_OK, or W_ERROR if your coordinates cause the window to move
  353.                   off the screen.
  354.  
  355. =======================================
  356. open
  357.       Opens a window object on the screen.
  358.  
  359.       USAGE:      int open (int sr,int sc,int er,int ec,
  360.                               int btype=W_DOUBLE,
  361.                               int wattr=_BLACK|LGREY,
  362.                               int battr=_BLACK|LGREY)
  363.  
  364.       RETURNS:    0 if successful.
  365.  
  366.       Required arguments.
  367.             sr    Start row for the window.
  368.             sc    Start column for the window.
  369.             er    End row for the window.
  370.             ec    End column for the window.
  371.  
  372.       Optional arguments.
  373.             btype Border type.  default is W_DOUBLE.
  374.                   W_NOBORDER        W_SPACES
  375.                   W_DOUBLE          W_SINGLE
  376.                   W_DOUSIN          W_SOLID
  377.                   W_SINDOU
  378.             wattr Window attribute. default is _BLACK|LGREY.
  379.             battr Border attribute. default is _BLACK|LGREY.
  380.  
  381.       EXAMPLE:
  382.             main()
  383.             {
  384.                   WinObj a;
  385.                   a.open (12,12,20,50);
  386.                   ~~~
  387.                   ~~
  388.                   ~
  389.             }
  390.  
  391. =======================================
  392. pan
  393.  
  394.       Adjust the virtual window by delta number of characters.  The window
  395.       automatically adjusts its pan location when the user moves the cursor. 
  396.       This keeps the cursor always in the visible window.  You can use pan to
  397.       adjust it manually if you need.
  398.  
  399.       USAGE:      int pan (int delta_y, int delta_x);
  400.  
  401.             delta_y,    the change in the x and y start coordinate.
  402.             delta_x
  403.  
  404.       RETURNS:    W_OK, W_NOTOPEN
  405.  
  406.       SEE:  set_pan()
  407.  
  408.  
  409.  
  410. =======================================
  411. printf
  412.  
  413.       Display a formatted string in the window at the current cursor position. 
  414.       This function works very much like the printf function in C.  This also
  415.       has an optional xy coordinates.
  416.  
  417.       If the y coordinate is 1 greater than max_y the window will scroll up 1
  418.       line and the new text will be inserted on a new blank line.
  419.  
  420.       USAGE:      void printf (char *,...);
  421.                   void printf ( int y, int x, char *,...);
  422.  
  423.       EXAMPLE:
  424.             main()
  425.             {
  426.                   WinObj a;
  427.                   int i = 2;
  428.                   a.open (12,12,20,50);
  429.                   a.gotoxy (5,5);
  430.                   a.printf ("( 2 + 2 = %d )",i+2);
  431.                   a.gotoxy ();
  432.                   a.printf ("This is the window origin.");
  433.                   ~
  434.                   a.close ();
  435.             }
  436.  
  437. =======================================
  438. putch
  439.       Display a single character in the window.  Cursor position will be updated
  440.       to the next window character.  The current window attribute will be used.
  441.  
  442.             USAGE:      void putch (char ch, int translate=W_OFF);
  443.                         void putch (int y, int x, char ch, int trans=W_OFF);
  444.  
  445.             translate   W_ON, LF will cause a cr/lf.  CR will be ignored.  \t
  446.                         will tab to the next tab position.  The default is to
  447.                         not translate.
  448. =======================================
  449. puts
  450.       Display a simple string to the window.  Cursor position will be updated to
  451.       the next window character.  The current window attribute will be used.
  452.  
  453.             USAGE:      void puts (char *str, int translate=W_ON);
  454.                         void puts (int y, int x, char *str, translate=W_ON);
  455.  
  456.             translate   W_ON, LF will cause a cr/lf.  CR will be ignored.  \t
  457.                         will tab to the next tab position.  The default is to
  458.                         not translate.
  459. =======================================
  460. set_active
  461.       Brings a window to the surface.  This will also unhide a function. 
  462.       Set_active is called each time you input a keystroke from a window.
  463.  
  464.       USAGE:      void set_active ();
  465.  
  466. =======================================
  467. set_attr
  468.       Sets a new default attribute for the window object.
  469.  
  470.       USAGE:      int set_attr (int new_attr);
  471.  
  472.       Required arguments.
  473.             new_attr    New attribute for window.  Can be any legal color
  474.  
  475.                         Mono screens will be remapped to use only black on white
  476.                         or white on black.  This is automatic.
  477.  
  478.       RETURNS:    previous attribute.
  479.  
  480.  
  481.       EXAMPLE:
  482.       main()
  483.       {
  484.             WinObj a;
  485.             a.open (12,12,20,50);
  486.             ~~~
  487.             a.new_attr (_RED|YELLOW);  // All characters from this point will
  488.                                           be displayed as yellow on red.
  489.             ~~~
  490.             ~~
  491.             ~
  492.             a.close();
  493.       }
  494. =======================================
  495. set_attr
  496.       changes the attribute for a region in a window.
  497.  
  498.       USAGE:      void set_attr (int new_attr, int y, int x, int cnt = 1);
  499.  
  500.             new_attr    new attribute for the region.
  501.             y,x         start y,x coordinates.
  502.             cnt         number of characters to change.  default is 1.
  503.  
  504. =======================================
  505. set_fill
  506.       Set the window fill character.  Default is spaces.
  507.  
  508.       USAGE:      void set_fill (char ch);
  509.  
  510. =======================================
  511.  
  512.  
  513. set_virtual
  514.       Changes the virtual height and width of a window.  This can only be done
  515.       when the window is closed.
  516.  
  517.       USAGE:      int set_virtual (int vh, int vw);
  518.             vh    new virtual height.
  519.             vw    new virtual width.
  520.  
  521.       Setting the vh and/or vw to zero causes them to be automatically set when
  522.       open is called.
  523.  
  524.       RETURNS:    W_OK or W_OPENED
  525.  
  526. =======================================
  527. size
  528.       Set a new size for the displayed window object.  The virtual height and
  529.       width are left unchanged.  This means you can not make a window larger
  530.       than its virtual sizes.
  531.  
  532.       USAGE:      int size (int new_height, int new_width);
  533.  
  534.       RETURNS:    W_OK, or W_ERROR if your new size is less than 1.
  535.  
  536. =======================================
  537. title
  538.       Add, change or remove a window title.  The window title will have the same
  539.       attribute as the window border.
  540.  
  541.       USAGE:      void title (char *str, int position = W_CENTER);
  542.  
  543.       Required arguments.
  544.             str         Title string to display.  If NULL then the window title
  545.                         will be removed.
  546.       Optional arguments.
  547.             position    Position of the title.  Default is W_CENTER.
  548.                         W_CENTER    W_LEFT        W_RIGHT
  549.  
  550.       EXAMPLE:
  551.             main()
  552.             {
  553.                   WinObj a;
  554.                   a.open (12,12,20,50);
  555.                   a.title ("[ Window 1 ]", W_LEFT);
  556.                   ~~~
  557.                   ~
  558.                   a.close();
  559.             }
  560. =======================================
  561. unhide
  562.       Unhide a hidden window object.
  563.  
  564.       USAGE:      void unhide ();
  565.  
  566. =======================================
  567. update
  568.       Update the window object.  This will display all buffered output.  The
  569.       window does not have to be the active window to be updated.
  570.  
  571.       USAGE:      void update ();
  572.       EXAMPLE:    see printf
  573.  
  574. =======================================
  575. update_all
  576.       Update all non hidden, open windows.  The order of active windows will not
  577.       change.  You can call this method from any window object.  This will be
  578.       most useful if your screen is damaged by some external program.
  579.  
  580.       USAGE:      void update_all ();
  581.  
  582.                                The << operator
  583.  
  584.       The << operator can be used for window output.  This is handy for those
  585.       who are use to the C++ ostream library.  The << operator has an override
  586.       for all the basic C data types.  The gotoxy routine has also been modified
  587.       to return a WinObj& which allows you to position the cursor and output
  588.       with << on the same line.
  589.  
  590.       EXAMPLES:
  591.  
  592.             WinObj w;
  593.  
  594.             w.open (.....);
  595.  
  596.             w.gotoxy (y, x) << "The answer is " << x;
  597.             w << '\n' << string << number << string << '\n';
  598.             w << "12 + 12 = " << 12+12;
  599.       
  600.       Also see the Demo program for examples using the << operator. Mouse Routines
  601.  
  602.  
  603.       You must have a MicroSoft compatible mouse with mouse.com loaded for mouse
  604.       support.  The mouse has 2 modes of operation.  The program can switch
  605.       between these modes at any time.
  606.  
  607.       To activate the mouse in your program you just make one function call:
  608.  
  609.             Win_mouse_mode (mode);
  610.  
  611.                   mode:
  612.                         M_FULL            full mouse support
  613.                         M_SIMPLE          simple mouse support
  614.                         M_NONE            no mouse support
  615.  
  616.       This routine is defined in WinMouse.HPP.  The definitions of the support
  617.       modes are listed below.
  618.  
  619.  
  620.       Simple support:
  621.             - there will be no mouse cursor present.
  622.  
  623.             - moveing the mouse is equal to using the arrow keys.
  624.  
  625.             - the right mouse button equates to the ESC key.
  626.  
  627.             - the left mouse button equates to ENTER.
  628.  
  629.       Full support:
  630.             - there will be a mouse cursor.
  631.  
  632.             - the right mouse button equates to the ESC key.
  633.  
  634.             - to make a menu selection, click the left button on the item of
  635.             your choice.
  636.  
  637.             - you can move any bordered window.  Move the mouse cursor to the
  638.             top border of the window you wish to move.  Press and hold the left
  639.             mouse button.  The top left edge of the window will follow the mouse
  640.             cursor until you release the left button.
  641.  
  642.             - you can resize any bordered window.  Move the mouse cursor to the
  643.             bottom right corner of the window.  Press and hold the left mouse
  644.             button.  You can now make the window shrink and grow by moving the
  645.             mouse.  The max size for any window is its virtual size.  Any window
  646.             which is smaller than its virtual size will have panning arrows on
  647.             the left and/or bottom border.
  648.  
  649.             - you can pan a window which has a virtual size larger then its
  650.             fisical size.  Just click on the panning arrows on the left or top
  651.             border.  Holding down on the left button will cause the window to
  652.             pan until the end.
  653.  
  654.             - you can scroll a pick list by clicking on the up/down arrows on
  655.             the left border of the window.
  656.  
  657.             - you can move the text cursor in a data entry window by clicking on
  658.             the field of your choice.
  659.  
  660.       The mouse support is created with a mouse class.  The class object is
  661.       declared in WinMouse.CPP.  This is a global object so you have access to
  662.       it, but be sure you understand the WinMouse class before accessing the
  663.       object directly.
  664.             The Object is declared as   WinMouse Win_mouse (M_NONE);
  665.  
  666.       You can safely use the following routines with LVS Windows.
  667.  
  668. Win_mouse_mode
  669.       Use this routine to change the mouse mode.  You can change the mode at any
  670.       time during your program.
  671.  
  672.       USAGE:      int Win_mouse_mode (int mode);
  673.  
  674.             mode  M_FULL
  675.                   M_SIMPLE
  676.                   M_NONE            turns mouse off
  677.  
  678.       RETURNS:    0 if no mouse detected
  679.                   -1 if mouse is present
  680.  
  681. =======================================
  682. set_mouseroutine
  683.       Each WinObj object is allowed a mouse routine.  This routine will be
  684.       called whenever a mouse click is detected in the bound of the window.  The
  685.       routine will even be called when the window is not the active window.  By
  686.       default each window object has no mouse routine.
  687.  
  688.       USAGE:      mouse_routine_t set_mouseroutine (mouse_routine_t);
  689.  
  690.             mouse_routine_t   is defined as a void function which takes two
  691.                               integers as arguments.
  692.                               ie:  void Routine (int y, int x);
  693.  
  694.       RETURNS:    a pointer to the previous routine.  Usualy you will ignore
  695.                   this.
  696.  
  697.       NOTES:      The Y/X values passed to the routine are the x/y coordinates
  698.                   within the window.  They are the windows coordinates not the
  699.                   screen coordinates.
  700.  
  701.       EXAMPLE:
  702.             void My_Mouse_Routine (int y, int x)
  703.             {
  704.                   Do something with the mouse click here.
  705.                   You have been passed the coordinates of the click
  706.                   so be creative.
  707.             }
  708.  
  709.             void main ()
  710.             {
  711.                   WinObj w;
  712.  
  713.                   Win_mouse_mode (M_FULL);
  714.  
  715.                   w.open (.....);
  716.                   w.set_mouseroutine (My_Mouse_Routine);
  717.                   .......
  718.                   .......
  719.             }                   Input Routines
  720.  
  721.  
  722. before
  723.       Assign a before get function to the previous get.  This function will be
  724.       called before the get takes place.
  725.  
  726.       USAGE:      int before (void (*func)(void *));
  727.  
  728.             func() will be called each time the user enters the get field.  
  729.  
  730.       The before function will be called with a void pointer to the current get
  731.       object.  This can be a int, long, double or string pointer.
  732.  
  733.       RETURNS:    W_OK  if successful.
  734.                   W_ERROR if no previous get.
  735.  
  736. =======================================
  737. get_key
  738.       Get a key from the keyboard at the current window location.  A refresh
  739.       will be automatically called if needed.  The physical cursor will be moved
  740.       to the correct window location.  You have an option of whether the key
  741.       will be echoed or not.  You can also cause a time out.
  742.  
  743.       USAGE:      int get_key (int echo = W_NOECHO, int seconds = 0);
  744.  
  745.       Optional arguments.
  746.             echo        Determine whether or not to echo the keystroke to the
  747.                         window.  default = no echo.  W_ECHO   W_NOECHO
  748.  
  749.             seconds     Max time to wait for a key.  0 is forever.
  750.  
  751.       RETURNS:    Ascii and key scan code from win.h.
  752.                   key & 0x00ff = Ascii character returned
  753.                   key >>8 = Scan code.
  754.  
  755.       EXAMPLE:
  756.             main()
  757.             {
  758.                   WinObj a;
  759.                   a.open (1, 1, 12, 40);
  760.                   a.printf ("This is a test string.");
  761.                   a.printf (2,0,"Press Escape to exit.");
  762.                   while (a.get_key() != ESC);
  763.                   a.close ();
  764.             }
  765. =======================================
  766. get
  767.       Get a variable from a screen window.  Will display each get with the
  768.       current get_attr attribute.  The compiler will determine which of the
  769.       following gets will be called.  You will have different options with
  770.       different variable types.
  771.  
  772.       USAGE:
  773.             int get (int y, int x, int &i, int len=4);
  774.                   Gets an integer from the window.  ex:  get (1, 1, i); default
  775.                   length is 4.
  776.  
  777.             int get (int y, int x, long int &i, int len=5);
  778.                   Gets a long int from the window.  ex:  get (1, 1, ld, 10);
  779.                   default length is 5.
  780.  
  781.             int get (int y, int x, double &d, int len=10, int dec=2);
  782.                   Gets a double from the window.  ex:  get (1, 1, d, 5, 1);
  783.                   Default length is 10 with 2 decimals.  The length includes the
  784.                   decimal place.  The decimal places can be from 1 to length -
  785.                   2.
  786.  
  787.             int get (int y, int x, char *str, char *picture=NULL);
  788.                   Gets a picture char string from the window.
  789.                   ex:  get (1, 1, str, "XXX-999-xxx");
  790.  
  791.             int get (int y, int x, char *str, char style, int length = 0);
  792.                   Gets a styled string from the window.  The valid styles are
  793.                   listed below.  The default length is 0.  0 uses the current
  794.                   length of the string or the predefined length of style.
  795.  
  796.             int get (int y, int x, char ch, int upper_case = 0);
  797.                   Gets a single character from the screen.  The upper case flag
  798.                   defaults to 0 which allows any character.  Any non zero value
  799.                   will force upper case.
  800.  
  801.       Valid Picture characters.
  802.             x     Allow any character.
  803.             X     Allow any character.  Letters will be converted to upper case.
  804.             a     Allow letters and spaces only.
  805.             A     Allow letters and spaces only.  Letters will be converted to
  806.                   upper case.
  807.             9     Allow numbers and spaces only.
  808.  
  809.             Any other characters in a picture clause will be forced into the
  810.             output string. ie ( , - and even spaces.
  811.  
  812.       Valid Style characters:
  813.             L     convert field to 'L'owercase.
  814.             U     convert field to 'U'ppercase.
  815.             F     convert 'F'irst character to upper-case.
  816.             D     MM/DD/YY date field.
  817.             S     999-99-9999 Social Security number field
  818.             P     (999) 999-9999 phone number.
  819.             Z     99999-9999 zip code.
  820.             A     any character mix.
  821.  
  822.       Notes:      If a NO picture is used the length of the string (str) will be
  823.                   used and any characters will be allowed.  This is the default.
  824.                   
  825.                   Be sure you have a NULL terminated string.
  826.  
  827.                   The length of the picture clause will override the len of the
  828.                   string.
  829.  
  830.                   If a style is used be sure the char * has enough space to
  831.                   accommodate the style type.  The length option can be used to
  832.                   control the length of the string.  However if the style is of
  833.                   a fixed length the style will override the length.  The len
  834.                   option is only useful for styles L, U, and F.  If len is 0
  835.                   the length of the string will be used for len.
  836.  
  837.       EXAMPLES:
  838.  
  839.       main
  840.       {
  841.             WinObj w;
  842.             char state[] = "  ";
  843.             long i=0;
  844.             double d;
  845.             char phone[16]="";
  846.             char name[16]="", ss[12]="";
  847.             char company[31]="";
  848.  
  849.             w.open (0, 0, 24, 79);
  850.  
  851.             w.get (10,10,state,'U'); // state forced to upper case.
  852.             w.get (12,10,i,3);      // get a 3 digit integer.
  853.             w.get (13,10,d);  // get a 2 decimal double, 10 chars. long
  854.             w.get (15,10,name,"Xxxxxxxxxxxxxx")  //   get a 15 char. name with
  855.                                                       the first character
  856.                                                       forced to upper.
  857.             w.get (20,10,phone,"(999) 999-9999"); //  get a phone number using
  858.                                                       a picture statement.
  859.             w.get (21,10,ss,'S');           //  get a ss # using a style.
  860.             w.get (22,10,company,'F',30);   //  get ucase string with length
  861.                                                 specified.
  862.  
  863.             w.read ();
  864.       }
  865.  
  866.       RETURNS:    W_OK if successful.
  867.                   W_ERROR if invalid x,y.
  868.                   W_NOTOPEN if window not opened.
  869.  
  870. =======================================
  871. set_getattr
  872.       Change the get attribute.  The default is _LGREY | BLACK.
  873.  
  874.       USAGE:      int set_getattr (int new_attr);
  875.  
  876.       RETURNS:    previous attribute.
  877.  
  878. =======================================
  879. update_gets
  880.       Update display of gets.  Safe to call from within read.  This can be used
  881.       to change the value of some of the gets in a valid function.  This will
  882.       display the changes.  Warning: No pictures will be checked.  Also do not
  883.       change string lengths.
  884.  
  885.       USAGE:      int update_gets ();
  886.  
  887.       RETURNS:    W_OK or W_NOTOPEN
  888.  
  889. =======================================
  890. valid
  891.       Assign a valid function to the previous get.
  892.  
  893.       USAGE:      int valid (int (*func) (void *));
  894.  
  895.       func() will be called each time the user attempts to leave the get field. 
  896.       read() will not let the user leave the current get until your valid
  897.       function returns a non zero value.  The read function will let the user
  898.       exit the read with a press of ESC regardless if the valid function returns
  899.       true.
  900.  
  901.       The valid function will be called with a pointer to the current get
  902.       object.  This can be a long, double or string pointer.
  903.  
  904.       RETURNS:    W_OK  if successful.
  905.                   W_ERROR if no previous get.
  906. =======================================
  907. clear_gets
  908.       Clear all gets for a window.  This allows you to use the get system to
  909.       display the data but not read it from the screen.
  910.  
  911.       USAGE:  void clear_gets ()
  912. =======================================
  913. read
  914.       Read all gets from the window object.
  915.  
  916.       USAGE:      int read();
  917.  
  918.             During the read the user can perform the following.
  919.  
  920.             Up/Down arrows    Move to the previous/next field.
  921.             Shift-Tab/Tab     Move to the previous/next field.
  922.             Enter             Move to the next field or exit the read if
  923.                               currently on the last field.
  924.             Right arrow       Move right one character in a string field.
  925.             Left arrow        Move left one character in a string field.  Acts
  926.                               like a backspace in numeric fields.
  927.             End/Home          Move to the last/first character in a string
  928.                               field.
  929.             Ctrl-right/ Pan the window right/left one character.
  930.             Ctrl-left arrow
  931.             Ctrl-Home/        Pan the window up/down one character.
  932.             Ctrl-End
  933.  
  934.       RETURNS:    Key pressed to exit read.  User can exit with an Enter on the
  935.                   last field, Escape, PgUp or PgDn.
  936. =======================================
  937. any_read_change
  938.       Allows you to test if a user made any changes during the previous read.
  939.  
  940.       USAGE:      int any_read_change ();
  941.  
  942.       RETURNS:    0 if no changes were made.
  943.                   non zero if changes were made. Information Routines
  944.  
  945.  
  946. do_youown
  947.       Ask a window object if it owns a coordinate on the screen.  If it does
  948.       then return the character and attribute of that coordinate.  Owning a
  949.       coordinate means the window is the most active in that spot on the screen. 
  950.       It is possible for a window to use a spot on the screen but not be the
  951.       current owner.  A hidden window owns NO spots on the screen.
  952.  
  953.       USAGE:      int do_youown (int y, int x, char &ch, char &attr);
  954.  
  955.             y,x   physical screen coordinates. 0,0 origin
  956.             ch    will return with the character if owned.
  957.             attr  will return with the attribute if owned
  958.  
  959.       RETURNS:    0 if not owned.
  960.                   1 if the window owns the coordinate.
  961.  
  962.       SEE:  who_owns()
  963.  
  964. ========================================
  965. get_pan
  966.       get the current virtual starting point for the displayed window.
  967.  
  968.       USAGE:      int get_pan (int &y, int &x)
  969.  
  970.             When called, get_pan will set y,x to the current start location for
  971.             the virtual window.
  972.  
  973.       RETURNS:    W_OK or W_NOTOPEN.
  974.  
  975. ========================================
  976. get_scr
  977.       get the current screen location of the window.
  978.  
  979.       USAGE:      int get_scr (int &sr, int &sc, int &er, int &ec);
  980.  
  981.             When called, get_scr will set sr,sc,er,ec to the current window
  982.             location on the screen.
  983.  
  984.       RETURNS:    W_OK or W_NOTOPEN
  985.  
  986. ========================================
  987. get_version
  988.       Return a pointer to the version of object windows.
  989.  
  990.       USAGE:      char *get_version ();
  991.  
  992.       RETURNS:    a pointer to "LVS Windows v##.##"
  993.  
  994. ========================================
  995.  
  996.  
  997. is_open
  998.       report windows open status.
  999.  
  1000.       USAGE:      int is_open ();
  1001.  
  1002.       RETURNS:    true if open, 0 if not.
  1003.  
  1004. ========================================
  1005. max_x
  1006.       get maximum x coordinate for window.
  1007.  
  1008.       USAGE:      int max_x ();
  1009.  
  1010.       RETURNS:    max x coordinate or W_NOTOPEN if window is not opened.
  1011.  
  1012. ========================================
  1013. max_y
  1014.       get maximum y coordinate for window.
  1015.  
  1016.       USAGE:      int max_y();
  1017.  
  1018.       RETURNS:    max y coordinate or W_NOTOPEN if window is not opened.
  1019.  
  1020. ========================================
  1021. ret_char
  1022.       retrieve a character from a window object.
  1023.  
  1024.       USAGE:      int ret_attr (int y, int x);
  1025.  
  1026.             x,y   Coordinates within the window.
  1027.  
  1028.       RETURNS:    The ascii value of the character at the given window
  1029.                   coordinates.
  1030.  
  1031. ========================================
  1032. ret_attr
  1033.       retrieve an attribute from a window object.
  1034.  
  1035.       USAGE:      int ret_attr (int y,int x);
  1036.  
  1037.       RETURNS:    The attribute value of the character at the given window
  1038.                   coordinates.
  1039.  
  1040. ========================================
  1041. wherex
  1042.       Returns the current cursor column.
  1043.  
  1044.       USAGE:      int wherex ();
  1045.  
  1046.       RETURNS:    the current x coordinate
  1047.  
  1048. ========================================
  1049.  
  1050.  
  1051. wherey
  1052.       Returns the current cursor row.
  1053.  
  1054.       USAGE:      int wherey ();
  1055.  
  1056.       RETURNS:    the current y coordinate
  1057.  
  1058. ========================================
  1059. wherexy
  1060.       get the current cursor location for the window.
  1061.  
  1062.       USAGE:      int wherexy (int &y, int &x);
  1063.  
  1064.             When called, wherexy will set y,x to the current cursor coordinates
  1065.  
  1066.       RETURNS:    W_OK or W_NOTOPEN.
  1067.  
  1068. ========================================
  1069. who_owns
  1070.       Return a pointer to the window object which owns a coordinate on the
  1071.       screen.
  1072.  
  1073.       USAGE:      WinObj *who_owns (int y, int x, char &ch, char &attr);
  1074.  
  1075.             y,x   physical screen coordinates.  0,0 origin.
  1076.             ch    will return with the character if owned by anyone.
  1077.             attr  will return with the attribute if owned by anyone.
  1078.  
  1079.       RETURNS:    A pointer to the window object who owns the spot on the
  1080.                   screen.  0 if not owned.
  1081.  
  1082.                                Printer Objects
  1083.  
  1084.  
  1085.                           Declaring a Printer Object
  1086.  
  1087.       Win_Prn <Object> (char *port = "LPT1", int v_h=66,int v_w=132)
  1088.  
  1089.             port  This is the printer port to use.  The default is LPT1.  You
  1090.                   can print to any legal DOS file name.  This includes LPT2,
  1091.                   COM1, FILENAME ....
  1092.  
  1093.             v_h   This is the number of lines on a page.  The printer classes
  1094.                   uses line feeds to eject the page so this must reflect the
  1095.                   true number of lines your printer has per page.  Default is
  1096.                   66, this works for dot matrix printers.  Lasers will be less.
  1097.  
  1098.             v_w   This is the width of your printer.  This number is the max_x
  1099.                   value when using printf, puts etc.  All text will wrap beyond
  1100.                   this point.  132 is a good default even for 80 column
  1101.                   printers. The print library trims all spaces before printing,
  1102.                   so if you didn't print anything beyond column 80 your output
  1103.                   will be fine.
  1104.  
  1105.       The height and width can be changed any time the printer is not opened,
  1106.       using the same set_virtual message as in WinObj.
  1107.  
  1108.       All WinObj formatting functions are available.  printf, puts etc.  You
  1109.       even use the x/y coordinates because the page is formatted entirely in
  1110.       memory before it prints.  This allows you to skip to line 50 then back up
  1111.       to 10.  Pretty neat eh?
  1112.             
  1113.       You can even use the get/read functions.  They will print the data the
  1114.       same as they would on the screen but will not prompt the user for
  1115.       anything.
  1116.  
  1117.             EXAMPLE:
  1118.             main()
  1119.             {
  1120.                   Win_Prn p;
  1121.                   double d = 123.12;
  1122.  
  1123.                   p.open ();
  1124.                   p.printf (10, 1, "This is a test on line 10 column 1");
  1125.                   p.puts (5, 1, "Same page on line 5");
  1126.                   p.puts (40, 1, "A double get:");
  1127.                   p.get (40, 15, d);      // display a get.
  1128.                   p.print_page ();        // actually print the page.
  1129.                   p.close ();             // destructor will handle if you
  1130.                                           wish.
  1131.             }
  1132.  
  1133.  
  1134.                            Printer Object Routines
  1135.  
  1136.  
  1137. open
  1138.       Opens the printer port/file and allocates the memory needed to preprint
  1139.       the page.
  1140.  
  1141.             USAGE:      int open ();
  1142.  
  1143.             RETURNS:    W_OK
  1144.                         W_OPENED    if already open.
  1145.                         W_ERROR     misc errors.
  1146.  
  1147. ===================================
  1148. Printer Setup Definitions:
  1149.       Change the printer escape sequences which the system will use. The
  1150.       defaults are Epson codes.  They can be found in Win_Prn.hpp. Use these
  1151.       routines to change the definitions for each Win_Prn object.  Can be called
  1152.       anytime.
  1153.  
  1154.             USAGE:
  1155.                   void define_init (char *new_init);
  1156.                   void define_reset (char *new_reset);
  1157.                   void define_underline (char *new_underline);
  1158.                   void define_bold (char *new_bold);
  1159.                   void define_compress (char *new_compress);
  1160.                   void define_normal (char *new_normal);
  1161.  
  1162.             init  is called after the printer is opened.
  1163.             reset is called before the printer is closed.
  1164.  
  1165.             NOTES:      
  1166.                   If you wish to disable one of these attributes call the
  1167.                   function with a NULL.
  1168.  
  1169. ===================================
  1170. close
  1171.       Closes the printer port/file and deallocates all used memory.  This is
  1172.       called by the destructor so you may not have to.  You will want to use
  1173.       this with networks to close the queue.
  1174.             
  1175.             USAGE:      void close ();
  1176.  
  1177. ===================================
  1178. clean_page
  1179.       This gives you a clean page to work on.  All it really does is call
  1180.       clr_win ();
  1181.  
  1182.             USAGE:      void clean_page ();
  1183.  
  1184. ===================================
  1185.  
  1186.  
  1187.  
  1188. change_port
  1189.       This allows you to change printer ports/files.  You can only call this
  1190.       when the port is not opened.
  1191.  
  1192.             USAGE:      int change_port (char *new_port);
  1193.  
  1194.                   new_port    can be a printer port (LPT1, LPT2..) or any valid
  1195.                               dos file name.
  1196.  
  1197.             RETURNS:    W_OK
  1198.                         W_OPENED
  1199.  
  1200. ===================================
  1201. print_page
  1202.       This prints the page you formatted in memory.  The page is not cleared
  1203.       when it finishes.  This allows you to reprint the page or add more data to
  1204.       it if you wish.  Use any of the WinObj functions to clear or reformat the
  1205.       page.
  1206.  
  1207.  
  1208.             USAGE:      int print_page (int pages = 1);
  1209.  
  1210.                   pages       number of copies to print.
  1211.  
  1212.             RETURNS:    W_OK
  1213.                         W_NOTOPEN
  1214.                         W_ERROR
  1215.  
  1216. ===================================
  1217. set_pageattr
  1218.       This changes the print attributes for the entire page.  Can be called any
  1219.       time.  Useful when the same routines are used for painting the screen as
  1220.       are used for printing a page.  You wouldn't want your screen attributes to
  1221.       come out on the printer.
  1222.  
  1223.             USAGE:      void set_pageattr (int new_attr);
  1224.  
  1225.                   new_attr    any of the valid printer attributes. P_NORMAL,
  1226.                               P_UNDERLINE, P_COMPRESS, P_BOLD
  1227.  
  1228.             NOTES:
  1229.                   Attributes can be ored (|) together, if your printer can
  1230.                   handle them.
  1231.  
  1232.                   Use these same attributes with the WinObj set_attr () to
  1233.                   change your attributes while painting the page.
  1234.  
  1235.                                 Menu Objects
  1236.  
  1237.  
  1238.       WinMenu  <Object>
  1239.  
  1240.       Menu objects are derived from WinObj objects.  This means the window
  1241.       messages are also available to the menu objects, with a few additions to
  1242.       aid in the constructions of menus.
  1243.  
  1244.  
  1245.       There are three necessary steps to creating a menu.
  1246.             1.)   Open the menu as you would any other window.  This gives it a
  1247.                   location and color on the screen.
  1248.             2.)   Declare your menu selections.  (prompt)
  1249.             3.)   Read the menu.  This returns the user selection.
  1250.  
  1251.             EXAMPLE:
  1252.                         main()
  1253.                         {
  1254.                               WinMenu  m;
  1255.                               m.open (4, 23, 16, 53, W_SOLID,
  1256.                                       _BLUE|WHITE, _BLUE|DGREY);
  1257.                               m.title ("[ Demo Menu ]");
  1258.                               m.prompt (1, 4, 1, "Data entry");
  1259.                               m.prompt (3, 4, 2, "Moving windows");
  1260.                               m.prompt (5, 4, 3, "Random windows");
  1261.                               m.prompt (7, 4, 4, "Menu demo");
  1262.                               m.prompt (9, 4, 0, "Quit");
  1263.                               int choice = m.read (1);
  1264.                               switch (choice) 
  1265.                                     {
  1266.                                     case 1:
  1267.                                           ~~~~~~
  1268.                                           break;
  1269.                                     case 2:
  1270.                                           ~~~~~~
  1271.                                           break;
  1272.                                     ~~~~~~
  1273.                                     }
  1274.                         }
  1275.  
  1276.                                 Menu Routines
  1277.  
  1278.  
  1279.  
  1280. prompt
  1281.       declares a menu selection.  The selection will not be displayed in the
  1282.       window until you call read.
  1283.  
  1284.       USAGE:      int prompt (int y, int x, int return_val, char *str,
  1285.                               char *message = NULL, char hot_key = 0);
  1286.  
  1287.             y           The start row in the menu window.
  1288.             x           The start column in the menu window.
  1289.             return_val  The value you wish this selection to return.
  1290.             str         The prompt string.
  1291.             message     The message to display in the optional message box when
  1292.                         this prompt is pointed to.
  1293.             hot_key     The key the user can press to make the selection.  The
  1294.                         default is the first character of str.
  1295.  
  1296.       RETURNS:    W_NOMEM if out of memory.
  1297.                   W_NOTOPEN if the menu has not been opened.
  1298.                   W_OK
  1299.  
  1300. ========================================
  1301. read
  1302.       Read the user selection from the menu window. The user can use the arrow
  1303.       keys to move from one selection to the next, then press Enter to make the
  1304.       selection.  The user can also press the hot letter of the menu selection. 
  1305.       The read function will also unhide a previously hidden menu object.
  1306.  
  1307.       USAGE:      int read (int start_pos);
  1308.  
  1309.             start_pos   the first selection to point to.  The read function will
  1310.                         attempt to match start_pos with one of the return_vals
  1311.                         used in the prompt function.  It will then point to this
  1312.                         selection first.
  1313.  
  1314.       RETURNS:    W_ERROR if no prompts were activated.
  1315.                   W_ESCAPE if escape was used to exit.
  1316.  
  1317.                   Otherwise it returns the return_val of the user selected
  1318.                   prompt.
  1319.  
  1320. ========================================
  1321. reset
  1322.       This resets a menu object and closes it so you can use it again for a
  1323.       different type of menu.
  1324.  
  1325.       USAGE:      void reset ();
  1326.  
  1327. ========================================
  1328.  
  1329.  
  1330. set_barattr
  1331.       This sets the attribute for the menu selection bar.  The default is
  1332.       _LGREY|BLACK.
  1333.  
  1334.  
  1335.       USAGE:      int set_barattr (int attr);
  1336.  
  1337.       RETURNS:    the previous attribute.
  1338.  
  1339. ========================================
  1340. set_keyattr
  1341.       This sets the attribute for the hot key of a selection.  The default is
  1342.       the same attribute as the rest of the selection.
  1343.  
  1344.       USAGE:      int set_keyattr (int attr);
  1345.  
  1346.       RETURNS:    the previous attribute.
  1347.  
  1348. ========================================
  1349. message_line
  1350.       This sets the screen line to display a menu message.  The menu read
  1351.       message will open a 1 line window using this entire screen line.  Your
  1352.       declared messages will be displayed in this window as the user moves the
  1353.       menu bar.
  1354.  
  1355.       USAGE:  int message_line (int new_line_no);
  1356.  
  1357.       new_line_no = the line number to use.  If this is less than 0 no message
  1358.       line will be used.  The menu object default is -1;
  1359.  
  1360.       RETURNS:    the previous line number.
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.       EXAMPLE:
  1384.       main()        // A lotus style menu.
  1385.       {
  1386.             WinMenu m;
  1387.             m.open (1,0,1,79,W_NOBORDER,_BLUE|WHITE);
  1388.             m.message_line (2);
  1389.             m.prompt (0, 1,1,"Worksheet","Global, Column, Status, Delete");
  1390.             m.prompt (0,12,2,"Range","Format, Label, Erase, Justify, Prot");
  1391.             m.prompt (0,19,3,"Copy","Copy a cell or range of cells");
  1392.             m.prompt (0,25,4,"Move","Move a cell or range of cells");
  1393.             m.prompt (0,31,5,"File","Retrieve, Save, Combine, Xtract...");
  1394.             m.prompt (0,37,6,"Print","Print a worksheet to a printer or file");
  1395.             m.prompt (0,44,0,"Quit","Quit the menu demo");
  1396.  
  1397.             int choice=1;
  1398.             while (choice != 0) 
  1399.                   {
  1400.                   choice = m.read(choice);
  1401.                   switch (choice) 
  1402.                         {
  1403.                         case 1:
  1404.                               menu_demo2 ();
  1405.                               break;
  1406.                         case 2:
  1407.                               break;
  1408.                         }
  1409.                   }
  1410.       }
  1411.  
  1412. ========================================
  1413. message_attr
  1414.       Changes the attribute for the message line.  The default is _BLACK|WHITE.
  1415.  
  1416.       USAGE:      int message_attr (int new_attr);
  1417.  
  1418.       RETURNS:    the previous attribute.
  1419.  
  1420.                               Pick-List Objects
  1421.  
  1422.  
  1423.  
  1424.       WinPick  <Object>
  1425.  
  1426.       Pick-List objects are derived from WinObj objects.  This means the window
  1427.       messages are also available to the pick-list objects, with a few additions
  1428.       to aid in the construction of pick-lists.
  1429.  
  1430.       There are three necessary steps to creating a pick-list.
  1431.             1.)   Open the pick-list window the same as you would open any other
  1432.                   window.  This gives it a location and color on the screen.
  1433.             2.)   Assign a char * array to the list object.
  1434.             3.)   Read the pick list.  This returns the user selection.
  1435.  
  1436.       EXAMPLE:
  1437.             char *list[] = {  "January","February",
  1438.                               "March","April",
  1439.                               "May","June",
  1440.                               "July","August",
  1441.                               "September","October",
  1442.                               "November","December", 0 };
  1443.  
  1444.             void main()
  1445.             {
  1446.                   WinPick pl;
  1447.                   pl.open (6,41,11,53,W_DOUSIN,_BLUE|WHITE,_BLUE|BLACK);
  1448.                   pl.prompt (list);
  1449.                   int choice = pl.read();
  1450.                   WinObj w;
  1451.                   w.open (6,23,11,53,W_DOUSIN,_BLUE|WHITE,_BLUE|BLACK);
  1452.                   w.printf (1,1,"You picked %s.",list[choice]);
  1453.                   w.set_attr(_BLUE|LGREY);
  1454.                   w.printf (3,1,"Press any key to continue.");
  1455.                   w.get_key();
  1456.             }
  1457.                              Pick-List Routines
  1458.  
  1459.  
  1460.  
  1461. prompt
  1462.       assigns an array of characters pointers to the list object.  This can be
  1463.       any size list of character strings.  The last element of the list must be
  1464.       a NULL pointer, or you must provide a count of items to pick from.
  1465.  
  1466.       USAGE:      void prompt (char *list[], int count = -1);
  1467.  
  1468.             list        a pointer to the list of strings.
  1469.             count       the number of elements to pick from. (Optional) if you
  1470.                         omit this parameter the WinPick object will search for
  1471.                         a NULL to determine the end of the list.
  1472.  
  1473. ========================================
  1474. read
  1475.       Gets the users choice from the pick list.
  1476.  
  1477.       USAGE:  int read();
  1478.  
  1479.       User Keys:  
  1480.             Up, Down    Point to the Previous/Next in list
  1481.             PgUp, PgDn  Move one window page.
  1482.             Home, End.  Move to the First/Last in list
  1483.  
  1484.             A match is attempted on any other key press.  The match is to the
  1485.             first letter/number of a field.  The search is started from the next
  1486.             field to the end then back to beginning of the list.
  1487.  
  1488.       RETURNS:    the element number of the users selection.
  1489.                         W_ERROR if the list window is not opened.
  1490.                         W_ESCAPE if list is exited with an escape.
  1491.  
  1492. ========================================
  1493. set_barattr
  1494.       Sets the attribute for the pick-list bar.  The default is _LGREY|BLACK
  1495.  
  1496.       USAGE:      int set_barattr (int new_attr);
  1497.  
  1498.       RETURNS:    the previous attribute.
  1499.  
  1500.                           Paradox Related Routines
  1501.  
  1502.  
  1503. The Paradox functions work similar to the regular get/read functions.  The
  1504. exception is, these functions work directly on a Paradox record buffer, so you
  1505. need not move data from the buffers to temporary variables.  Do to the Paradox
  1506. being a large model library, these functions are available in the Large model
  1507. only.
  1508.  
  1509. EXAMPLE:
  1510.       #include <pxengine.h>
  1511.       #include "winobj.hpp"
  1512.  
  1513.       main ()
  1514.       {
  1515.             TABLEHANDLE TblHandle;
  1516.             RECORDHANDLE RecHandle;
  1517.  
  1518.             PXInit ();        // Init the PX engine
  1519.             PXTblOpen ("SALES", &TblHandle, 0, 0);    // Open the table
  1520.             PXRecBufOpen (TblHandle, &RecHandle);     // Open a record buffer
  1521.             PXRecFirst (TblHandle); // Point to the first record
  1522.             PXRecGet (TblHandle, RecHandle);    // Read the record.
  1523.  
  1524.             WinObj w;                           // my window object
  1525.  
  1526.             w.open (0, 0, 24, 79);              // Open the window
  1527.  
  1528.             w.PXrecord (TblHandle, RecHandle);  // give winobj the PX info
  1529.  
  1530.             w.PXget (1, 1, 1, 'F');       // Get the first field, style 'F'
  1531.             w.PXget (3, 1, 2, 'F');
  1532.             w.PXget (5, 1, 11, 'P');            // Get the 11 field, style
  1533.                                                 Phone
  1534.             w.PXget (7, 1, 17, 10, 2);
  1535.             w.PXget (9, 1, 18, 3, 0);
  1536.  
  1537.             w.PXread ();                        // Read the user input
  1538.  
  1539.             PXRecUpdate (TblHandle, RecHandle); // update the PX record
  1540.  
  1541.             PXExit ();  // Stop the PX engine
  1542.       }
  1543.       
  1544.  
  1545. ========================================
  1546. PXrecord
  1547.             Defines the Paradox table and record handles to LVS Windows.
  1548.             - You must first open the PX table and record buffer.
  1549.             - You must call this function before any PXget calls.
  1550.             - You can PXget data from more than one PX table by calling
  1551.               this function between the gets.
  1552.  
  1553.             USAGE:      void PXrecord(TABLEHANDLE t, RECORDHANDLE r);
  1554.  
  1555. ========================================
  1556. PXget
  1557.             Work like 'get' to define a get field on the screen.  The field is
  1558.             displayed when PXget is called.  There is more than one way to call
  1559.             a PXget.  The length of Ascii fields will be set to the length in
  1560.             the PX table.
  1561.  
  1562.             USAGE:
  1563.                   int PXget (int y, int x, FIELDHANDLE f)
  1564.                         - Generic PXget.  Used to get any field type.
  1565.                         - Strings will be of style 'A'ny character.
  1566.                         - Dates will be of style 'D'.
  1567.                         - Numbers will be input as len of 10 with 2 decimals.
  1568.  
  1569.                   int PXget (int y, int x, FIELDHANDLE f, int len, int dec)
  1570.                         - Used to input PX number fields only.  Ascii or Date
  1571.                           fields will return an error.
  1572.                         - Decimals can be from 0 - (1 less than len)
  1573.  
  1574.                   int PXget (int y, int x, FIELDHANDLE f, char style)
  1575.                         - Used to input Ascii or Date fields
  1576.                         - You can use any of the valid 'get' styles.
  1577.                         - Date fields will be forced to type 'D'.
  1578.                               
  1579.                   int PXget (int y, int x, FIELDHANDLE f, char *picture)
  1580.                         - Used to input Ascii fields only.
  1581.                         - You can use any of the valid 'get' pictures.
  1582.  
  1583.             RETURNS:
  1584.                   W_OK
  1585.                   W_ERROR     if PXrecord not called, the windows isn't open or
  1586.                               an invalid field type for the PXget.
  1587.  
  1588. ========================================
  1589. PXread
  1590.             Read the PXgets from the user.  This works just like 'read ()'.  You
  1591.             must call PXread when any of your gets are from a Paradox record
  1592.             buffer.  Not all the gets have to be of type PXget.  The PXread
  1593.             function will work on any regular get.
  1594.  
  1595.             USAGE:      int PXread ();
  1596.  
  1597.             RETURNS:    Key pressed to exit read.  User can exit with an Enter
  1598.                         on the last field, Escape, PgUp or PgDn. High Level Tools
  1599.  
  1600.  
  1601. Win_Calendar
  1602.             Display a simple calendar on the screen.  The calendar will first
  1603.             display with the current month.  The user can change the date using
  1604.             the arrow keys.  Escape or Q exits the calendar.  The calendar can
  1605.             be used in a Win_setonkey assignment.
  1606.  
  1607.             USAGE:      void Win_Calendar ();
  1608.  
  1609. ========================================
  1610. Win_Calculator
  1611.             Display a simple calculator on the screen.  This is a basic 4
  1612.             function calculator.  ( +-*/ )  Enter is the same as =.  C = Clear, 
  1613.             E = ClearEntry, S = toggle sign of result, R = Square Root of
  1614.             result.
  1615.  
  1616.             The calculator can be assigned a got key with Win_setonkey.
  1617.  
  1618.             USAGE:      void Win_Calculator ();
  1619.  
  1620. ========================================
  1621. Win_Error
  1622.             Display an error message on the screen.  Wait 10 seconds for a user
  1623.             key press to exit the message.
  1624.  
  1625.             USAGE:  void Win_Error (char *msg = "Error", 
  1626.                                     int win_attr = _RED|BLACK,
  1627.                                     int bor_attr = _RED|WHITE);
  1628.  
  1629.                   msg         Error message to display.  Default = "Error"
  1630.                   win_attr    Message window attribute.
  1631.                   bor_attr    Message window border attribute.
  1632.  
  1633. ========================================
  1634. Win_Ask_YN
  1635.             Display a message in a window and wait for a user Y or N response.
  1636.  
  1637.             USAGE:      int Win_Get_YN (char *msg = "Yes or No",
  1638.                                     int winattr = _GREEN|BLACK, 
  1639.                                     int borattr = _GREEN|BLACK);
  1640.  
  1641.                   msg         Question to ask user.
  1642.                   winattr     Window attribute.
  1643.                   borattr     Border attribute.
  1644.  
  1645. ========================================
  1646. Win_Get_Choice
  1647.             Prompt the user for a single key response.  All user responses will
  1648.             be converted to upper case.
  1649.  
  1650.             USAGE:      char Win_Get_Choice (char *msg, char *choices, 
  1651.                                           int win_attr = _GREEN|BLACK,
  1652.                                           int bor_attr = _GREEN|WHITE);
  1653.  
  1654.                   msg         Question to ask the user.
  1655.                   choices     Possible letter choices for the user.
  1656.                   winattr     Window attribute.
  1657.                   borattr     Border attributes.
  1658.  
  1659.             RETURNS:    the users response. Global Window Object Routines
  1660.  
  1661. Win_whos_active
  1662.       Returns an object pointer to the currently active window object.  This is
  1663.       a friend function to WinObj class.
  1664.  
  1665.       USAGE:      WinObj *Win_whos_active ();
  1666.  
  1667.       RETURNS:    A pointer to the currently active window or NULL if none are
  1668.                   active.
  1669.  
  1670.       EXAMPLE:
  1671.             
  1672.             WinObj *w;
  1673.  
  1674.             w = Win_whos_active ();
  1675.             w->title ("I'm the active window");
  1676. ========================================
  1677. Win_close_all
  1678.       Close all open windows.  This routine is provide to allow you to clean up
  1679.       the screen before calling the exit () function.  Normaly windows are close
  1680.       when the destructors are called.  However when you call exit() the
  1681.       destructors are not called and the windows remain open on the screen.  If
  1682.       your program exits normaly by returning to main() you won't need this
  1683.       function.  If you call exit() while any windows are open you may want to
  1684.       call this routine.
  1685.  
  1686.       USAGE:      void Win_close_all ();
  1687.                              Low Level Routines
  1688.  
  1689.  
  1690.                                Screen Functions
  1691.  
  1692.  
  1693. Win_init
  1694.       Start the low level screen system.  This is called automatically by the
  1695.       first window function used.  This function will clear the screen the first
  1696.       time it is called.  You can call this function manually to take advantage
  1697.       of the mode flags.
  1698.  
  1699.       USAGE:      void Win_init (int mode);
  1700.  
  1701.             mode: W_MONO  =   Force mono attributes only.
  1702.                   W_BIOS  =   Force bios screen writes.
  1703.                   W_DEFAULT = Auto detect the system configuration.
  1704.                   W_SNOW  =   Force CGA snow checking.
  1705.                   W_NOCLEAR = don't clear the screen during init.
  1706.  
  1707.             Any of these modes can be combined by oring.
  1708.                   example:  Win_init (W_BIOS | W_MONO);
  1709.  
  1710. ========================================
  1711. Win_clr
  1712.       Clear a section of the screen with an attribute.
  1713.       No testing is done on screen coordinates.
  1714.  
  1715.       USAGE:      void Win_clr (int sr,int sc, int er, int ec,int color);
  1716.  
  1717. ========================================
  1718. Win_clrscr
  1719.       Clear the entire display screen.
  1720.  
  1721.       USAGE:      void Win_clrscr ();
  1722.  
  1723. ========================================
  1724. Win_currentmode
  1725.       Return the current screen write modes.
  1726.       The modes returned will be | together.
  1727.  
  1728.       USAGE:      int Win_currentmode ();
  1729.  
  1730.       RETURNS:    current screen write modes.
  1731.  
  1732.       EXAMPLES:   if (Win_currentmode () & W_MONO)
  1733.                         then mono mapping is on
  1734. ========================================
  1735. Win_dispch
  1736.       Display a character on the screen.
  1737.       No coordinate testing is done.
  1738.  
  1739.       USAGE:      void Win_dispch (int y, int x, int color, char ch);
  1740.  
  1741. ========================================
  1742. Win_dispst
  1743.       Display a NULL terminated string on the screen.
  1744.  
  1745.       USAGE:      void Win_dispst ( int y, int x, int color, 
  1746.                                     char *str, int max );
  1747.  
  1748.             x/y         coordinates 0,0 origin.
  1749.             color       attribute.
  1750.             str         pointer to string.
  1751.             max         max number of characters to display in case string is
  1752.                         not null terminated.
  1753.  
  1754. ========================================
  1755. Win_gotoxy
  1756.       Move the cursor on the screen.  0,0 origin.
  1757.  
  1758.       USAGE:      void Win_gotoxy (int y, int x);
  1759.  
  1760. ========================================
  1761. Win_hidecur
  1762.       Hide the screen cursor.
  1763.  
  1764.       USAGE:      void Win_hidecur();
  1765.  
  1766. ========================================
  1767. Win_getpage
  1768.       Get the active video page.  Also adjust the low level video segment for
  1769.       direct screen writes.
  1770.  
  1771.       USAGE:      int Win_getpage ();
  1772.  
  1773.       RETURNS:    the number of the active page.  0-3
  1774.  
  1775. ========================================
  1776. Win_restore
  1777.       Restore a sectoin of the screen saved with Win_save.  The buffer will be
  1778.       freed by this routine.
  1779.  
  1780.       USAGE:      void Win_restore (int ulr, int ulc, int lrr, int lrc, 
  1781.                                     int *scr_data);
  1782.  
  1783.       ulr, ulc, lrr, lrc      screen coordinates.  uses sames as Win_save.
  1784.       scr_data                value returned from Win_save.
  1785.  
  1786. ========================================
  1787. Win_save
  1788.       Save a section of the screen.  This routine will allocate the memory
  1789.       needed for the save.  NULL will be returned if no memory was available.
  1790.  
  1791.       USAGE:      int *Win_save (int ulr, int ulc, int lrr, int lrc);
  1792.  
  1793.             ulr   upper left row (y)
  1794.             ulc   upper left column (x)
  1795.             lrr   lower right row (y2)
  1796.             lrc   lower right column (x2)
  1797.  
  1798.       RETURNS:    pointer to the saved screen data.  NULL if not enough memory
  1799.                   or invalid screen coordinates are used.  You will need this
  1800.                   pointer to restore the section of screen.
  1801.  
  1802. ========================================
  1803. Win_setpage
  1804.       Set the active video page.  After setting the page Win_getpage will be
  1805.       called to adjust the video segment.
  1806.  
  1807.       USAGE:      int Win_setpage (int new_page);
  1808.  
  1809.             new_page    0 - 3
  1810.  
  1811.       RETURNS:    W_OK, W_ERROR if an invalid page.
  1812.  
  1813. ========================================
  1814. Win_settabsize
  1815.       Set the tab size for printf, puts and putch.  The tab size is only in
  1816.       effect when translate is on.  The default is 4 spaces.
  1817.  
  1818.       USAGE:      int Win_settabsize ();
  1819.  
  1820.       RETURNS:    previous tab size.
  1821. ========================================
  1822. Win_showcur
  1823.       Unhide the screen cursor.
  1824.  
  1825.       USAGE:      void Win_showcur();
  1826.  
  1827. ========================================
  1828. Win_beep
  1829.       Beep the speaker.
  1830.  
  1831.       USAGE:      void Win_beep();
  1832.  
  1833. ========================================
  1834. Win_mono
  1835.       Turn black & white color re-mapping on or off.
  1836.  
  1837.       USAGE:      void Win_mono (int on_off);
  1838.  
  1839.             Call with W_ON or W_OFF
  1840.  
  1841. ========================================
  1842.  
  1843. Win_snow
  1844.       Turn snow checking on or off.
  1845.  
  1846.       USAGE:      void Win_snow(int on_off);
  1847.  
  1848.             Call with W_ON or W_OFF
  1849. ========================================
  1850. Win_bios
  1851.       Turn bios writes on or off.
  1852.  
  1853.       USAGE:      void Win_bios (int on_off);
  1854.  
  1855.             Call with W_ON or W_OFF
  1856.  
  1857.  
  1858.                                 VGA Functions
  1859.  
  1860. VGA_fontload
  1861.       Loads the special line drawing characters for window borders.  You can
  1862.       make this call as often as you like.  There is no undo for this call. 
  1863.       This gives your windows more of a graphic look.
  1864.  
  1865.       This routine remaps some of the seldom used line drawing characters.  It
  1866.       then calles Win_Load_Alt_Border () to point all border types at the new
  1867.       characters.
  1868.  
  1869.       This routine will do nothing if a vga color monitor is not detected.  So
  1870.       you can make the call with an monitor type.
  1871.  
  1872.       USAGE:      int VGA_fontload ();
  1873.  
  1874.       RETURNS:    W_ERROR if a non VGA-color is detected.
  1875.                   W_OK if the font was loaded.
  1876.  
  1877. ========================================
  1878. VGA_videotype
  1879.       Determines the video type.
  1880.  
  1881.       USAGE:      int VGA_video_type ();
  1882.  
  1883.       RETURNS:    V_VGA, V_EGA, V_CGA, V_MCGA, V_MONO
  1884.  
  1885. ========================================
  1886. VGA_setblink
  1887.       Toggles attribute blink mode.  Allows highlighted background on VGA
  1888.       displays.
  1889.  
  1890.       USAGE:      int VGA_set_blink (int on_off);
  1891.  
  1892.             on_off      W_ON allows blinking attributes.
  1893.                         W_OFF allows highlighted background.
  1894.  
  1895.       RETURNS:    W_OK
  1896.                   W_ERROR if not a VGA screen
  1897.  
  1898. ========================================
  1899. VGA_setlines
  1900.       Change the number of text lines per screen on VGA displays.
  1901.  
  1902.       USAGE:      int VGA_setlines (int line_cnt);
  1903.  
  1904.             line_cnt    25, 28, or 50
  1905.  
  1906.       RETURNS:    W_OK
  1907.                   W_ERROR if not a VGA screen Key Functions
  1908.  
  1909.  
  1910. Win_getkey
  1911.       Get a key stroke from the keyboard.  You can have a time out on the key. 
  1912.       If the no key is pressed in the time out period 0 will be returned.
  1913.  
  1914.       USAGE:  int Win_getkey(int seconds = 0);
  1915.  
  1916.                   seconds = max time to wait for a key.
  1917.                           default = 0.  0 = wait forever.
  1918.  
  1919.       RETURNS:    scan code + ascii value of key pressed.
  1920.  
  1921.             Scan code   =   key >> 8
  1922.             ascii value =   key & 0x00ff
  1923. ========================================
  1924. Win_keystuf
  1925.       Stuff a keystroke in the internal buffer.
  1926.  
  1927.       USAGE:  int Win_keystuf (int key);
  1928.                   key    =   Scan code + ascii value of key to stuff.
  1929.  
  1930.       Key strokes are stacked not queued.  If you wish to display
  1931.       a string you must insert the keystrokes in reverse.
  1932.             Example:
  1933.                         char *str = "Keyboard stuff routine";
  1934.                         int i = strlen(str);
  1935.                         while (i)
  1936.                               Win_keystuf(str[--i]);
  1937.  
  1938.       RETURNS:    W_OK or W_ERROR if the buffers is full.
  1939.                         Buffer holds 40 keystrokes.
  1940. ========================================
  1941. Win_lastkey
  1942.       Return the last key gotten by Win_getkey
  1943.  
  1944.       USAGE:  int Win_lastkey ();
  1945.  
  1946.       RETURNS:   scan code + ascii value of key gotten.
  1947. ========================================
  1948. Win_setonkey
  1949.       Assign a function to a hot key.  You may use as may hot keys
  1950.       as you like.  You can turn off a hot key by assigning the
  1951.       key to NULL.
  1952.  
  1953.       USAGE:  void Win_setonkey (int key,void (* func)(void));
  1954.  
  1955.       key          = scan code/ascii code combination of hot key.
  1956.                           Many of the keys are defined in WIN.H
  1957.       func        = pointer to the hot key function.  If NULL then
  1958.                           hot key will be deactivated.
  1959. ========================================
  1960. Win_setbkloop
  1961.       Assign a function to execute while waiting for a keypress.  You can only
  1962.       have one function assigned at a time.  To turn off this process assign
  1963.       NULL.
  1964.  
  1965.       USAGE:  void Win_setbkloop (void (* func)(void));
  1966.  
  1967.  
  1968.                               String Functions
  1969.  
  1970.  
  1971. str_clear
  1972.       Clears a string to a given number of spaces
  1973.  
  1974.       USAGE:      char *str_clear (char *str, int len);
  1975.             str =   String to be cleared.
  1976.             len =   New length of string.
  1977.  
  1978.       RETURNS:    a pointer to str.
  1979. ========================================
  1980. str_setsz
  1981.       Sets the size of a char string.
  1982.  
  1983.       USAGE:      char *str_setsz (char *str, int len);
  1984.  
  1985.             str =   String to be truncated or padded.
  1986.             len =   New length of string.
  1987.  
  1988.       RETURNS:    pointer to str.
  1989. ========================================
  1990. strfill
  1991.       Return a string filled with a character.
  1992.  
  1993.       USAGE:  char *strfill (char ch,int count);
  1994.  
  1995.             ch  =   character to use.
  1996.             cnt =   length of return string.  MAX of 149.
  1997.  
  1998.       RETURNS:    pointer to a static string buffer or NULL if invalid length.
  1999. ========================================
  2000. strtrim
  2001.       Trims trailing spaces from a string.
  2002.  
  2003.       USAGE:   char *strtrim (char *str);
  2004.  
  2005.       RETURNS: pointer to the string which was trimmed.
  2006. ========================================
  2007. is_in
  2008.       Test a string for a given character.
  2009.  
  2010.       USAGE:  int is_in (char ch,char *str);
  2011.  
  2012.       RETURNS: 0 if ch is not in str.
  2013.                    1 if ch is in str.
  2014.  
  2015.  
  2016.                               Revision History
  2017.  
  2018.  
  2019.  
  2020. vc.0  1/10/91
  2021.       First Release of LVS Windows.
  2022.  
  2023. vc.1  2/12/91
  2024.       * Added functions
  2025.             - char *get_version ()
  2026.             - int set_getattr (int)
  2027.       * Enhanced performance
  2028.       * Fixed a few misc bugs
  2029.  
  2030. v1.11a      2/25/91
  2031.             * Moved WinObj & WinPick destructor out side of include file.
  2032.             * Added Functions:
  2033.                         - int update_get ()
  2034.  
  2035. v1.12 2/28/91
  2036.             * Fixed a bug which cropped up when using BC++ in place of TC++
  2037.  
  2038. v1.2  3/05/91
  2039.             * Improved window update performance.
  2040.             * gotoxy (y,x) printf (y,x,...) and bprintf (y,x,..) have been
  2041.             modified.   When y is 1 greater than max_y () the window will scroll
  2042.             up 1 line and insert a new one at the end.
  2043.             * Added access to show_cursor ().
  2044.             * get_version () now returns a pointer to "LVS Windows v###".
  2045.  
  2046. v1.3  3/15/91
  2047.             * Added putch() and puts() as fast alternatives to printf().
  2048.             * Increased speed of update function for active window.
  2049.             * Enhanced WinPick::read ().  Added Home / End keys, also search
  2050.               for list item match to key press.
  2051.             * Fixed major bug in hide ().  Caused infinite loop.
  2052.  
  2053. v1.3a 3/20/91
  2054.             * Improved speed of update (), Win_dispch() and Win_dispatst().
  2055.  
  2056. v1.5  4/18/91
  2057.             * Renamed to LVS Windows.
  2058.             * Improved get system.
  2059.                         - Added integer get.
  2060.                         - Added before (); before get function call.
  2061.                         - Cleaned up obj pointers.
  2062.             * Added box ();  box drawing in a window
  2063.             * Added WinTools.HPP
  2064.                         - Win_Calculator ()
  2065.                         - Win_Calendar ()
  2066.                         - Win_Error ()
  2067.                         - Win_Get_YN ()
  2068.                         - Win_Get_Choice ()
  2069.             * Added seconds parameter to Win_getkey (int seconds = 0);
  2070.                         - Allows time out for key if desired.
  2071.                         - Default is 0,  (forever).
  2072.                         - This parameter also caries over to w.get_key ();
  2073.             * Now compile Win_low.c & Win_func as a c++ file.
  2074.                         - Not sure why I ever compiled as C.
  2075.             * Added len parameter to:
  2076.                   w.get (int y, int x, char *str, char style, int len);
  2077.             * Changed some key functions to virtual.
  2078.             * Added Win_Prn class. 
  2079.                         - This is a powerful printer class which gives you all
  2080.                         the output power of a WinObj object to your printer.
  2081.                         - All the printf, puts, putc and gets will format to
  2082.                         your printer like they would to the screen. (except for
  2083.                         color)
  2084.                         - Set any page size.  Paint an entire page at a time in
  2085.                         memory, then print the page.  Start with a clear page or
  2086.                         where you left off to get the next page.
  2087.                         - This print method allows random printing on a page. 
  2088.                         even with dot matrix printers.
  2089.                         - Has ability to Underline, Bold, and Compress print. 
  2090.                         The defaults are Epson codes, but you can change them.
  2091.  
  2092. v1.51 4/25/91
  2093.             * Added some PC Information functions.
  2094.                         Share_Loaded ();
  2095.                         Print_Loaded ();
  2096.                         Assign_Loaded ();
  2097.                         Himem_Loaded ();
  2098.                         Novell_Loaded ();
  2099.             * Made shadows transparent.
  2100.             * Fixed a hole in WinObj::open (), which allowed an invalid border
  2101.             type.
  2102.             * Fixed a hole in WinMenu::message, which didn't account for a null
  2103.               message.
  2104.  
  2105. v1.52   5/20/91
  2106.             * Added get () for single characters
  2107.             * Added wherey () and wherex ()
  2108.  
  2109. v1.6  6/01/91
  2110.             * Added update_all () to update all open, unhidden windows.
  2111.             * Added support for Paradox Engine reads and gets.
  2112.                   - Now you can read and get fields directly from the
  2113.                     Paradox record buffer.
  2114.                   - Added:    PXrecord (), PXget (), and PXread ();
  2115.                   - See Paradox section of doccumentation.
  2116.             * Revised Screen painter to produce support code for
  2117.               the Paradox Engine.
  2118.             * Paradox is a trademark of Borland.
  2119.  
  2120. v1.62   6/07/91
  2121.             * Added optional parameter to WinMenu.prompt ();
  2122.                   - hot key.  This allows you to select a hot key other
  2123.                     than the first key in the string.
  2124.             * Added WinMenu.set_keyattr ();
  2125.                   - Allows you to pick a different attribute for the hot key
  2126.                     in a menu.
  2127.             * Added WinObj.any_read_change ();
  2128.                   - Allows you to see if the user made any changes during
  2129.                     the last read.
  2130.  
  2131. v1.63   6/11/91
  2132.             * Win_Get_YN () now accepts an ESC as a no.
  2133.             * 'F' style in gets now changes the first letter of each word in
  2134.               a get to upper case.
  2135.  
  2136. v2.0    08/20/91
  2137.             * Added mouse support.
  2138.             * Tab/Shift Tab changes to next/previous field.
  2139.             * Changed method for inputing doubles.  and fixed bug.
  2140.             * Support for Zortech 3.0 C++ compiler.
  2141.             * 50/28 line VGA support.
  2142.             * Added border type 6.
  2143.             * add WinObj *Win_whos_active ().
  2144.             * Added overloading of << operator for output.
  2145.             * '\n' now causes a cr/lf in a window when using puts, putch, printf
  2146.             and <<.  These can be controlled with the translate flag.
  2147.             * Added printf_translate () to change translate mode.
  2148.  
  2149. v2.01    08/26/91
  2150.             * Added start parameter to pick list read ().
  2151.             * Move cursor after decimal with doubles.
  2152.             * Fixed some minor bugs.
  2153.  
  2154. v2.02    09/11/91
  2155.             * Added void Win_close_all(), to close all windows.
  2156.  
  2157. v2.1     09/27/91
  2158.             * New look for scroll bars.  more Windows like.
  2159.             * Smother border redraw routine.  Improves moves and resizeing.
  2160.             * Better grabbing routine when moving a window with the mouse.
  2161.             * Better scroll bars for Pick Lists.
  2162.  
  2163. v2.11    10/01/91
  2164.             * Added W_NOCLEAR flag to Win_init ();
  2165.             * Added Win_save() and Win_restore();
  2166.  
  2167. v2.2     10/10/91
  2168.             * Smoothed window moves and resizes.
  2169.             * Added Win_settabsize ();
  2170.             * \t no translated in printf, puts and putch
  2171.  
  2172. v2.3     10/15/91
  2173.             * the title_str parameter in title() is now copied into a buffer. 
  2174.             You can now pass a local string.
  2175.             * More VGA support -- New box drawing characters.
  2176.  
  2177. v2.31     10/25/91
  2178.             * mono attributes now map correctly for menu bars.
  2179.             * added Win_currentmode ().                          Index
  2180.  
  2181.  
  2182. Declaring a Window Object. . . . . . . . . . . . . . 6
  2183. Features of LVS Windows. . . . . . . . . . . . . . . 2
  2184. Files Included . . . . . . . . . . . . . . . . . . . 5
  2185. Global Window Routines . . . . . . . . . . . . . . .40
  2186.       Win_close_all. . . . . . . . . . . . . . . . .40
  2187.       Win_whos_active. . . . . . . . . . . . . . . .40
  2188. High Level Tools . . . . . . . . . . . . . . . . . .38
  2189.       Win_Ask_YN . . . . . . . . . . . . . . . . . .38
  2190.       Win_Calculator . . . . . . . . . . . . . . . .38
  2191.       Win_Calendar . . . . . . . . . . . . . . . . .38
  2192.       Win_Error. . . . . . . . . . . . . . . . . . .38
  2193.       Win_Get_Choice . . . . . . . . . . . . . . . .38
  2194. Information Routines . . . . . . . . . . . . . . . .24
  2195.       do_youown. . . . . . . . . . . . . . . . . . .24
  2196.       get_pan. . . . . . . . . . . . . . . . . . . .24
  2197.       get_scr. . . . . . . . . . . . . . . . . . . .24
  2198.       get_version. . . . . . . . . . . . . . . . . .24
  2199.       is_open. . . . . . . . . . . . . . . . . . . .24
  2200.       max_x. . . . . . . . . . . . . . . . . . . . .25
  2201.       max_y. . . . . . . . . . . . . . . . . . . . .25
  2202.       ret_attr . . . . . . . . . . . . . . . . . . .25
  2203.       ret_char . . . . . . . . . . . . . . . . . . .25
  2204.       wherex . . . . . . . . . . . . . . . . . . . .25
  2205.       wherexy. . . . . . . . . . . . . . . . . . . .26
  2206.       wherey . . . . . . . . . . . . . . . . . . . .26
  2207.       who_owns . . . . . . . . . . . . . . . . . . .26
  2208. Input Routines . . . . . . . . . . . . . . . . . . .19
  2209.       any_read_change. . . . . . . . . . . . . . . .23
  2210.       before . . . . . . . . . . . . . . . . . . . .19
  2211.       clear_gets . . . . . . . . . . . . . . . . . .22
  2212.       get. . . . . . . . . . . . . . . . . . . . . .20
  2213.       get_key. . . . . . . . . . . . . . . . . . . .19
  2214.       read . . . . . . . . . . . . . . . . . . . . .23
  2215.       set_getattr. . . . . . . . . . . . . . . . . .21
  2216.       update_gets. . . . . . . . . . . . . . . . . .22
  2217.       valid. . . . . . . . . . . . . . . . . . . . .22
  2218. Key Functions. . . . . . . . . . . . . . . . . . . .46
  2219. Low Level Routines . . . . . . . . . . . . . . . . .41
  2220.       is_in. . . . . . . . . . . . . . . . . . . . .48
  2221.       str_clear. . . . . . . . . . . . . . . . . . .48
  2222.       str_setsz. . . . . . . . . . . . . . . . . . .48
  2223.       strfill. . . . . . . . . . . . . . . . . . . .48
  2224.       strtrim. . . . . . . . . . . . . . . . . . . .48
  2225.       VGA_fontload . . . . . . . . . . . . . . . . .45
  2226.       VGA_setblink . . . . . . . . . . . . . . . . .45
  2227.       VGA_setlines . . . . . . . . . . . . . . . . .45
  2228.       VGA_videotype. . . . . . . . . . . . . . . . .45
  2229.       Win_beep . . . . . . . . . . . . . . . . . . .43
  2230.       Win_bios . . . . . . . . . . . . . . . . . . .44
  2231.       Win_clr. . . . . . . . . . . . . . . . . . . .41
  2232.       Win_currentmode. . . . . . . . . . . . . . . .41
  2233.       Win_dispch . . . . . . . . . . . . . . . . . .41
  2234.       Win_dispst . . . . . . . . . . . . . . . . . .42
  2235.       Win_getkey . . . . . . . . . . . . . . . . . .46
  2236.       Win_getpage. . . . . . . . . . . . . . . . . .42
  2237.       Win_gotoxy . . . . . . . . . . . . . . . . . .42
  2238.       Win_hidecur. . . . . . . . . . . . . . . . . .42
  2239.       Win_init . . . . . . . . . . . . . . . . . . .41
  2240.       Win_keystuf. . . . . . . . . . . . . . . . . .46
  2241.       Win_lastkey. . . . . . . . . . . . . . . . . .46
  2242.       Win_mono . . . . . . . . . . . . . . . . . . .43
  2243.       Win_restore. . . . . . . . . . . . . . . . . .42
  2244.       Win_save . . . . . . . . . . . . . . . . . . .42
  2245.       Win_setbkloop. . . . . . . . . . . . . . . . .46
  2246.       Win_setonkey . . . . . . . . . . . . . . . . .46
  2247.       Win_setpage. . . . . . . . . . . . . . . . . .43
  2248.       Win_settabsize . . . . . . . . . . . . . . . .43
  2249.       Win_showcur. . . . . . . . . . . . . . . . . .43
  2250.       Win_snow . . . . . . . . . . . . . . . . . . .43
  2251. Menu Objects . . . . . . . . . . . . . . . . . . . .30
  2252. Menu Routines. . . . . . . . . . . . . . . . . . . .31
  2253.       message_attr . . . . . . . . . . . . . . . . .33
  2254.       message_line . . . . . . . . . . . . . . . . .32
  2255.       prompt . . . . . . . . . . . . . . . . . . . .31
  2256.       read . . . . . . . . . . . . . . . . . . . . .31
  2257.       reset. . . . . . . . . . . . . . . . . . . . .31
  2258.       set_barattr. . . . . . . . . . . . . . . . . .32
  2259.       set_keyattr. . . . . . . . . . . . . . . . . .32
  2260. Mouse Routines . . . . . . . . . . . . . . . . . . .16
  2261.       set_mouseroutine . . . . . . . . . . . . . . .18
  2262.       Win_mouse_mode . . . . . . . . . . . . . . . .18
  2263. Paradox Routines . . . . . . . . . . . . . . . . . .36
  2264.       PXget. . . . . . . . . . . . . . . . . . . . .37
  2265.       PXread . . . . . . . . . . . . . . . . . . . .37
  2266.       PXrecord . . . . . . . . . . . . . . . . . . .36
  2267. Pick-List Objects. . . . . . . . . . . . . . . . . .34
  2268. Pick-List Routines . . . . . . . . . . . . . . . . .35
  2269.       prompt . . . . . . . . . . . . . . . . . . . .35
  2270.       read . . . . . . . . . . . . . . . . . . . . .35
  2271.       set_barattr. . . . . . . . . . . . . . . . . .35
  2272. Printer Object Routines. . . . . . . . . . . . . . .28
  2273.       change_port. . . . . . . . . . . . . . . . . .29
  2274.       clean_page . . . . . . . . . . . . . . . . . .28
  2275.       close. . . . . . . . . . . . . . . . . . . . .28
  2276.       open . . . . . . . . . . . . . . . . . . . . .28
  2277.       print_page . . . . . . . . . . . . . . . . . .29
  2278.       set_pageattr . . . . . . . . . . . . . . . . .29
  2279. Printer Objects. . . . . . . . . . . . . . . . . . .27
  2280. Registration Information . . . . . . . . . . . . . . 3
  2281. Screen Functions . . . . . . . . . . . . . . . . . .41
  2282. String Functions . . . . . . . . . . . . . . . . . .48
  2283. The << operator. . . . . . . . . . . . . . . . . . .15
  2284. VGA Functions. . . . . . . . . . . . . . . . . . . .45
  2285. WinObj Routines. . . . . . . . . . . . . . . . . . . 7
  2286.       Border . . . . . . . . . . . . . . . . . . . .10
  2287.       box. . . . . . . . . . . . . . . . . . . . . . 7
  2288.       center . . . . . . . . . . . . . . . . . . . . 7
  2289.       change_border. . . . . . . . . . . . . . . . . 7
  2290.       close. . . . . . . . . . . . . . . . . . . . . 8
  2291.       clr_eol. . . . . . . . . . . . . . . . . . . . 8
  2292.       clr_win. . . . . . . . . . . . . . . . . . . . 8
  2293.       del_line . . . . . . . . . . . . . . . . . . . 8
  2294.       gotoxy . . . . . . . . . . . . . . . . . . . . 9
  2295.       hide . . . . . . . . . . . . . . . . . . . . . 9
  2296.       ins_line . . . . . . . . . . . . . . . . . . . 9
  2297.       move . . . . . . . . . . . . . . . . . . . . . 9
  2298.       open . . . . . . . . . . . . . . . . . . . . .10
  2299.       pan. . . . . . . . . . . . . . . . . . . . . .10
  2300.       printf . . . . . . . . . . . . . . . . . . . .11
  2301.       putch. . . . . . . . . . . . . . . . . . . . .11
  2302.       puts . . . . . . . . . . . . . . . . . . . . .11
  2303.       set_active . . . . . . . . . . . . . . . . . .11
  2304.       set_attr . . . . . . . . . . . . . . . . . . .12
  2305.       set_fill . . . . . . . . . . . . . . . . . . .12
  2306.       set_virtual. . . . . . . . . . . . . . . . . .12
  2307.       size . . . . . . . . . . . . . . . . . . . . .13
  2308.       title. . . . . . . . . . . . . . . . . . . . .13
  2309.       unhide . . . . . . . . . . . . . . . . . . . .13
  2310.       update . . . . . . . . . . . . . . . . . . . .13
  2311.       update_all . . . . . . . . . . . . . . . . . .14
  2312.